﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustManger.aspx.cs" Inherits="Module_CustManger" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

     <style type="text/css">
        .highlight
        {
            background-color: lightgreen;
        }
        .highlight .x-grid3-col
        {
            background-image: none;
        }
        
        .x-grid3-row-selected .highlight
        {
            background-color: yellow;
        }
        .x-grid3-row-selected .highlight .x-grid3-col
        {
            background-image: none;
        }
    </style>



    


</head>
<body>
    <form id="form1" runat="server"><script type="text/javascript">
        function AddTab(url, ids, texts) {
            var node = {
                attributes: {
                    href: url
                },
                text: texts,
                id: ids
            };
            this.parent.addExampleTab.apply(this.parent, [node]);
        }

    </script>

    <script type="text/javascript">
        var highlightRowsClientID = '<%= highlightRows.ClientID %>';
        var gridClientID = '<%= Grid1.ClientID %>';

        function highlightRows() {
            var highlightRows = X(highlightRowsClientID);
            var grid = X(gridClientID);

            grid.el.select('.x-grid3-row table.highlight').removeClass('highlight');

            Ext.each(highlightRows.getValue().split(','), function (item, index) {
                if (item !== '') {
                    var row = grid.getView().getRow(parseInt(item, 10));
                    Ext.get(row).first().addClass('highlight');
                }
            });

        }

        // 页面第一个加载完毕后执行的函数
        function onReady() {
            var grid = X(gridClientID);
            grid.addListener('viewready', function () {
                highlightRows();
            });
        }

        // 页面AJAX回发后执行的函数
        function onAjaxReady() {
            highlightRows();
        }
    </script>
    <ext:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
    <ext:Panel ID="Panel1" runat="server" BodyPadding="0px" EnableBackgroundColor="true"
        ShowBorder="false" ShowHeader="false" Title="Panel" Layout="Fit">
        <Toolbars>
            <ext:Toolbar runat="server" ID="tool1">
                <Items>
                <ext:HiddenField ID="highlightRows" runat="server">
                </ext:HiddenField>
                    <ext:Button ID="BtnAdd" runat="server" Text="新增客户" OnClick="BtnAdd_Click">
                    </ext:Button>
                    <ext:Button ID="Button2" runat="server" Text="删除客户" ConfirmText="是否删除选中客户" OnClick="Button2_Click">
                    </ext:Button>
                    <ext:Button ID="Button9" runat="server" Text="查找客户" Hidden="true">
                    </ext:Button>
                    <ext:Button ID="Button1" runat="server" Text="刷新" OnClick="Button1_Click">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </Toolbars>
        <Items>
            <ext:Panel ID="Panel2" runat="server" BodyPadding="0px" EnableBackgroundColor="true"
                ShowBorder="false" ShowHeader="false" Title="Panel" Layout="Fit">
                <Items>
                    <ext:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="true" EnableRowNumber="true"
                        ShowBorder="false" ShowHeader="false" AllowPaging="true" Title="Grid" DataKeyNames="custID"
                        OnRowDataBound="Grid1_RowDataBound" PageSize="20" IsDatabasePaging="true"
                        OnPageIndexChange="Grid1_PageIndexChange" >
                        <Columns>
                            <ext:TemplateField >
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbf" Text="客户信息" runat="server" />
                                </ItemTemplate>
                            </ext:TemplateField>
                            <ext:TemplateField >
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbfOption" Text="高管意见" runat="server"/>
                                </ItemTemplate>
                            </ext:TemplateField>
                            <ext:BoundField HeaderText="客户名称" DataField="CustName" />
                            <ext:BoundField HeaderText="联系电话" DataField="TelPhone" />
                            <ext:BoundField HeaderText="客户地址" DataField="CustAddress" />
                            <ext:BoundField HeaderText="所在公司" DataField="CompanyName" />
                            <ext:BoundField HeaderText="法人代表" DataField="Legal" />
                        </Columns>
                    </ext:Grid>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Panel>
    <ext:Window ID="Window1" runat="server" Height="500px" IsModal="true" Popup="false"
        Title="Window" Width="300px" EnableIFrame="true" IFrameUrl="#">
    </ext:Window>
    <ext:Window ID="Window2" runat="server" Height="350px" IsModal="true" Popup="false"
        Title="Window" Width="600px" EnableIFrame="true" IFrameUrl="#">
    </ext:Window>
    <ext:Window ID="Window3" runat="server" Height="400px" IsModal="true" Popup="false" OnClose="Window3_close"
        Title="Window" Width="500px" EnableIFrame="true" IFrameUrl="#">
    </ext:Window>

    <ext:Window ID="Window4" runat="server" Height="500px" IsModal="true" Popup="false" EnableIFrame="true"
        Title="Window" Width="850px">
    </ext:Window>

    </form>
</body>
</html>
